package com.example.zg.androidnewview;

import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;

public class CoordinatorLayoutActivity extends AppCompatActivity {
    private NestedScrollView nestedScrollView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_coordinator_layout);

        init();

    }


    public void init() {
        nestedScrollView=findViewById(R.id.nestedScrollView);
    }

    public void toTop(View view) {
        nestedScrollView.scrollTo(0,0);
    }
}
